package com.qin.mall.openfeign.product;

import com.qin.mall.common.api.CommonResult;
import com.qin.mall.common.api.MyBatisPlusPage;
import com.qin.mall.domain.PmsProductAttributeCategory;
import com.qin.mall.dto.PmsProductAttributeCategoryItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/** 产品属性结合分类
 * @author Leisure
 * create 2022 2022/11/19 10:22
 **/
@FeignClient("product-manage")
public interface ProductAttributeCategoryFeigin {
    /**
     * 产品属性结合分类
     */
    //创建属性分类
    @PostMapping("/productAttribute/category/create$")
    public CommonResult create(@RequestParam("name") String name);

    //修改属性分类
    @PostMapping("/productAttribute/category/update$/{id}")
    public CommonResult update(@PathVariable Long id, @RequestParam("name") String name);

    //删除单个属性分类
    @GetMapping("/productAttribute/category/delete$/{id}")
    public CommonResult deleteById(@PathVariable Long id);

    //获取单个属性分类
    @GetMapping("/productAttribute/category$/")
    public CommonResult selectById(@RequestParam("id") Long id);

    //分页查询属性分类
    @GetMapping("/productAttribute/category/list$")
    public CommonResult<MyBatisPlusPage<PmsProductAttributeCategory>> selectPage(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
                                                                                 @RequestParam(value = "pageSize",defaultValue = "5") Integer pageSize);

    //获取包含属性的属性分类、分类属性一起查出来
    @GetMapping("/productAttribute/category/list/withAttr$")
    public CommonResult<List<PmsProductAttributeCategoryItem>> getListWithAttr();

}
